<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'boollist.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" type="text/css" href="css/common.css">

<SCRIPT type="text/javascript" src="js/calendar.js"></SCRIPT>
<SCRIPT type="text/javascript" src="js/changeimage.js"></SCRIPT>

  </head>
  
  <body>
    <div class="centerdiv">
    	<s:form action="jsp_admin_bookadd.action" method="post" theme="simple" enctype="multipart/form-data">
    		<table class="bookadd">
    			<tr>
 					<td class="bookadd_title">添加新的图书资料</td>
 				</tr>
 				<tr>
    				<td><hr/></td>
    			</tr>
    			<tr>
    				<td align="center">
    					<table>
			    			<tr>
			    				<td>图书名称：</td>
			    				<td><s:textfield name="title"></s:textfield></td>
			    			</tr>
			    			<tr>
			    				<td>作者：</td>
			    				<td><s:textfield name="author"></s:textfield></td>
			    			</tr>
			    			<tr>
			    				<td>分类选择：</td>
			    				<td>
			    					<select name="typeId">
			    						<s:iterator value="#session.typeList">
					    					<s:if test="%{typeId!=0}">
					    						<option value="<s:property value='typeId' />">
					    							<s:property value="typeName" />
					    						</option>
					    					</s:if>
					    				</s:iterator>
			    					</select>
			    				</td>
			    			</tr>
			    			<tr>
			    				<td>出版社：</td>
			    				<td><s:textfield name="publisher"></s:textfield></td>
			    			</tr>
			    			<tr>
			    				<td>出版时间：</td>
			    				<td><s:textfield name="publishTime" readonly="true" onclick="calendar.show(this);"></s:textfield></td>
			    			</tr>
			    			<tr>
			    				<td>isbn：</td>
			    				<td><s:textfield name="isbn"></s:textfield></td>
			    			</tr>
			    			<tr>
			    				<td>单价：</td>
			    				<td><s:textfield name="price"></s:textfield></td>
			    			</tr>
			    			<tr>
			    				<td>总数量：</td>
			    				<td><s:textfield name="totalAmount"></s:textfield></td>
			    			</tr>
			    			<tr>
			    				<td>剩余数量：</td>
			    				<td><s:textfield name="remainder"></s:textfield></td>
			    			</tr>    			
			    			<tr>
			    				<td>封面：</td>
			    				<td><span class="bookadd_image"></span>
			    					<s:file name="picturePath" onchange="changeImage(this,'image');"></s:file></td>
			    			</tr>
			    			<tr>
			    				<td>内容简介：</td>
			    				<td id="bookadd_content"><s:textarea name="content" ></s:textarea></td>
			    			</tr>
			    			<tr>
			    				<td colspan="2" align="right">
			    					<s:submit value="添加"></s:submit>
			    					<s:reset value="重置"></s:reset>
			    				</td>
			    			</tr>
    					</table>
    				</td>
    			</tr>
    			
    		</table>
    	</s:form>
    </div>
  </body>
</html>
